﻿using System;
using System.ServiceModel;
namespace Purchasing
{

    [ServiceContract]
    public interface IPurchase
    {
        [OperationContract]
        int Purchase(string itemCode, double qty);
    }

    public class PurchasingService : IPurchase
    {
        public int Purchase(string itemCode, double qty)
        {
            return new Random(itemCode.GetHashCode()).Next();
        }
    }

}
